package com.xinshujia.utils;

/**
 * *************************************
 * *   @author: 野狼上校               **
 * *   @since: 2024-07-23 18:46       **
 * *   @version: 1.0                  **
 * *************************************
 * <p>
 * <p>
 * 命令相关的常量
 */
public class FunctionConstants {
    // 关闭采集
    public static final String FUNCTION_CLOSE_COLLECT = "{\"function\" :\"write_register_uint16\",\"regaddr\":4,\"regcount\":1,\"regcontent\":0}";
    // 开启采集
    public static final String FUNCTION_OPEN_COLLECT = "{\"function\" :\"write_register_uint16\",\"regaddr\":4,\"regcount\":1,\"regcontent\":1}";

    // 开启报警
    public static final String FUNCTION_OPEN_ALARM_X = "{\"function\" :\"write_register_uint16\",\"regaddr\":22092,\"regcount\":1,\"regcontent\":1}";
    public static final String FUNCTION_OPEN_ALARM_Y = "{\"function\" :\"write_register_uint16\",\"regaddr\":22097,\"regcount\":1,\"regcontent\":1}";
    public static final String FUNCTION_OPEN_ALARM_Z = "{\"function\" :\"write_register_uint16\",\"regaddr\":22102,\"regcount\":1,\"regcontent\":1}";

    // 关闭报警
    public static final String FUNCTION_CLOSE_ALARM_X = "{\"function\" :\"write_register_uint16\",\"regaddr\":22092,\"regcount\":1,\"regcontent\":0}";
    public static final String FUNCTION_CLOSE_ALARM_Y = "{\"function\" :\"write_register_uint16\",\"regaddr\":22097,\"regcount\":1,\"regcontent\":0}";
    public static final String FUNCTION_CLOSE_ALARM_Z = "{\"function\" :\"write_register_uint16\",\"regaddr\":22102,\"regcount\":1,\"regcontent\":0}";

    // 清除报警
    public static final String FUNCTION_CLEAR_ALARM = "{\"function\" :\"write_register_uint32\",\"regaddr\":22266,\"regcount\":2,\"regcontent\":15}";

    // 查询阈值
    public static final String FUNCTION_QUERY_THRESHOLD_X = "{\"function\" :\"read_register_float32\",\"regaddr\":22093,\"regcount\":2}";
    public static final String FUNCTION_QUERY_THRESHOLD_Y = "{\"function\" :\"read_register_float32\",\"regaddr\":22098,\"regcount\":2}";
    public static final String FUNCTION_QUERY_THRESHOLD_Z = "{\"function\" :\"read_register_float32\",\"regaddr\":22103,\"regcount\":2}";
// sql语句：SELECT json_extract( `Function`, '$.regcontent') FROM `Function` WHERE DeviceGUID=#{guid}

    // 修改阈值
    public static final String FUNCTION_UPDATE_THRESHOLD_X = "{\"function\" :\"write_register_float32\",\"regaddr\":22093,\"regcount\":2,\"regcontent\":";
    public static final String FUNCTION_UPDATE_THRESHOLD_Y = "{\"function\" :\"write_register_float32\",\"regaddr\":22098,\"regcount\":2,\"regcontent\":";
    public static final String FUNCTION_UPDATE_THRESHOLD_Z = "{\"function\" :\"write_register_float32\",\"regaddr\":22103,\"regcount\":2,\"regcontent\":";

// X轴：{"function":"write_register_float32","regaddr":22093,"regcount":2,"regcontent":20.0}
// Y轴：{"function":"write_register_float32","regaddr":22098,"regcount":2,"regcontent":20.0}
// Z轴：{"function":"write_register_float32","regaddr":22103,"regcount":2,"regcontent":20.0}
}
